<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>菜单管理</title>
<link rel="StyleSheet" href="<c:url value='/admin/css/general.css'/>" type="text/css" />
<script type="text/javascript" src="<c:url value='/admin/js/util/dtree.js'/>"></script>
<script type="text/javascript" src="<c:url value='/admin/js/util/jquery-1.8.1.min.js' />" ></script>
</head>
<body>
<div id="container">
<div class="dtree">
<script type="text/javascript">
		function goPage(url) {
			document.getElementById("Frame").src = url;
		}
		
		var d = new dTree('d');
		var preUrl = "<c:url value='/'/>";
		var url = preUrl + "admin/menuAction!modify.do?menuId=0&s=" + Math.random();
		var rootUrl = "<c:url value='" + url + "'/>";
		d.add(0,-1,'菜单管理',"javascript:goPage('" + rootUrl + "')");
		$.ajax({
			type:"POST",
			url:"<c:url value='/admin/menuAction!getAllMenu.do'/>",
			async:false,				
			data:{},
			dataType:"JSON",
			success:function(n){				
				if (n) {
					$(n).each(function(i, item){
						curl = preUrl + "admin/menuAction!modify.do?menuId=" + item.id + "&s=" + Math.random();
						subPage = "javascript:goPage('" + curl + "');";
						d.add(parseInt(item.id), parseInt(item.pId), item.name, subPage);
					});
					
					document.write(d);
				}	
			}
		});		
	</script>
</div>
<div class="main"><iframe id="Frame" width="100%" height="100%" border="0" frameborder="0" src=""> 此为内容部分</iframe></div>
</div>
</body>
</html>